<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>FileUpload</title>
<script type="text/javascript" src="<@full_path path='js/jquery-2.1.1.min.js' />"></script>
</head>
<body>
	<form method="post" action="<@full_path path='file/file_upload/upload_image.jhtml'/>">
		<input type="file" name="file">
	</form>
	<input type="button" value="Submit" onclick="submit();">

	<script type="text/javascript">
		function submit() {
			
			var action = $("form").attr("action");
			
			$.ajax({
				url : action,
				type : 'POST',
				processData : false,
				contentType : false,
				data : new FormData($("form")[0]),
				dataType : 'json',
				success : function(data) {
					console.log(data);
				}
			});
		}
	</script>
</body>
</html>